# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-crispy-bootstrap4
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
_pkgreal=crispy-bootstrap4
pkgver=2024.1
pkgrel=1
pkgdesc="Bootstrap4 template pack for django-crispy-forms"
url="https://pypi.org/project/crispy-bootstrap4/"
arch="noarch"
license="MIT"
depends="python3 py3-django-crispy-forms"
checkdepends="python3-dev py3-pytest py3-pytest-cov py3-pytest-django"
makedepends="py3-setuptools py3-gpep517 py3-wheel"
source="$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/c/crispy-bootstrap4/crispy-bootstrap4-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
subpackages="$pkgname-pyc"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
0d90bac9f70500947a209ab59c4c239f55adab096b7d5b9e4c0ebf92e898165c6b112618b29a09a9934d9ccf77e694a18c15f69fab0d30029bc8a09fbafc0477  py3-crispy-bootstrap4-2024.1.tar.gz
"
